
package jweslley.ContestVolumes.VolumeC;

import static java.lang.Math.abs;

import java.util.Scanner;

import jweslley.Problem;
import jweslley.Problem.Status;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/100/10038.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 16/10/2008
 */
@Problem(Status.Accepted)
public class JollyJumpers {

	static final String JOLLY = "Jolly";
	static final String NOT_JOLLY = "Not jolly";

	static Scanner in = new Scanner(System.in);

	static String doJolly(int n) {
		int x, previous;
		previous = in.nextInt();
		for (int i = n; i > 1; i--) {
			x = in.nextInt();
			if (abs(x - previous) != (i - 1)) {
				return NOT_JOLLY;
			}
			previous = x;
		}
		return JOLLY;
	}

	public static void main(String[] args) {
		StringBuilder out = new StringBuilder();
		int n;
		String result;
		while (in.hasNext()) {
			n = in.nextInt();
			result = (n == 1) ? JOLLY : doJolly(n);
			in.nextLine();
			out
			.append(result)
			.append('\n');
		}
		System.out.print(out);
	}

}
